package practice;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class practice013 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		try {

		} finally {
			scanner.close();
		}
	}

	// n * n  方块不重
	public static void test(int testNum, Map<Integer, List<List<Integer>>> sq) {
		for (int i = 0; i < testNum; i++) {
			while (sq.entrySet().iterator().hasNext()) {
				Entry<Integer, List<List<Integer>>> mapEntry = sq.entrySet().iterator().next();
				int key = mapEntry.getKey();
				List<List<Integer>> sqList = mapEntry.getValue();

				boolean flag = false;
				List<Integer> temp = new ArrayList<>();

				for (int j = 0; j < key; j++) {

					List<Integer> list = sqList.get(j);
					temp.add(list.get(0));

					for (int k = 0; k < list.size() - 1; k++) {
						if (list.get(k) == list.get(k + 1)) {
							System.out.println("No");
							flag = true;
							break;
						}
					}

					if (flag) {
						break;
					}
				}

				for (int t = 0; t < temp.size() - 1; t++) {
					if (temp.get(t) == temp.get(t + 1)) {
						System.out.println("No");
						flag = true;
						break;
					}
				}

				if (!flag) {
					System.out.println("Yes");
				}
			}
		}
	}
}
